package com.yangxd.hospital.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yangxd.hospital.entity.Registration;
import com.baomidou.mybatisplus.extension.service.IService;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author yangxd
 * @since 2021-05-07
 */
public interface RegistrationService extends IService<Registration> {

    /**
     * 根据用户id获得所有预约记录
     * @param userId
     * @return
     */
    List<Registration> getHisById(Integer userId);

    /**
     * 用户插入挂号记录
     *
     * @param registration
     */
    void saveRegistration(Registration registration);

    /**
     * 医生获取被预约的记录
     * @param doctorId
     * @return
     */
    List<Registration> getManById(Integer doctorId);

    /**
     * 更改预约状态
     * @param status
     */
    void updateStatus(Integer status,Integer registrationId);

    /**
     * 分页查询所有挂号记录
     * @param page
     * @param wrapper
     * @return
     */
    IPage<Registration> findPageRegistration(Page<Registration> page, @Param(Constants.WRAPPER) QueryWrapper<Registration> wrapper);

    int selectNum(Integer doctorId);
}
